package io.plus.interactive.task.queue;

import java.util.concurrent.ConcurrentLinkedQueue;

/**
 * 统一队列
 */
public class QueueImpl<T> implements Queue<T> {
    private ConcurrentLinkedQueue<T> queue = new ConcurrentLinkedQueue<>();

    @Override
    public boolean add(T t) {
        return queue.add(t);
    }

    @Override
    public T poll() {
        return queue.poll();
    }

    @Override
    public void clear() {
        queue.clear();
    }

    @Override
    public int size() {
        return queue.size();
    }

    @Override
    public boolean isEmpty() {
        return queue.isEmpty();
    }

}
